class Employee(object):
    """员工类"""

    # is_leave= 0 表示在职 1 表示离职
    def __init__(self, name, gender, age, mobile_number, is_leave=0):
        self.name = name
        self.gender = gender
        self.age = age
        self.mobile_number = mobile_number
        self.is_leave = False if is_leave == 0 else True  # is_leave = True 离职 否则在职

    def __str__(self):
        msg = '离职' if self.is_leave else '在职'
        return f'{self.name}\t{self.age}\t{self.gender}\t{self.mobile_number}\t{msg}'


if __name__ == '__main__':
    e = Employee('张三', '女', 23, '121212',0)
    print(e.__dict__)  # 把python对象转换为字典
    print(vars(e))  # 把python对象转换为字典
    print(e)
